<%--
  Created by IntelliJ IDEA.
  User: jhx0221
  Date: 2021/4/25
  Time: 11:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<% String path = request.getContextPath() + "/"; %>
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <base href="<%=path%>">
    <meta charset="UTF-8">
    <title>商业模式</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="layui/css/font.css">
    <link rel="stylesheet" href="layui/css/xadmin.css">
    <script src="layui/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="layui/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th colspan="8" style="font-size: 16px;font-weight: bold;">
                                (一)盈利模式
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr align="center">
                            <td rowspan="2" style="width: 230px;">
                                描述公司的盈利模式或上传相关附件
                            </td>
                            <td colspan="7">
                                   <textarea placeholder="请输入内容" name="desc" class="layui-textarea">
                                       ${BusinessDto.CBusinessmodelWithBLOBs.profitMemo}
                                   </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn"><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (二)生产模式
                            </td>
                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                                生产流程描述或上传相关附件
                            </td>
                            <td colspan="7">
                                   <textarea placeholder="请输入内容" name="desc" class="layui-textarea">
                                       ${BusinessDto.CBusinessmodelWithBLOBs.productMemo}
                                   </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn"><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                                主要产品的产能、产量以及销售量描述或上传相关附件
                            </td>
                            <td colspan="7">
                                   <textarea placeholder="请输入内容" name="desc" class="layui-textarea">
                                       ${BusinessDto.CBusinessmodelWithBLOBs.productOutput}
                                   </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn"><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr align="center">
                            <td>
                                近3年前5大主要供应商采购情况
                            </td>
                            <td colspan="7">
                                <table>
                                    <c:choose>
                                        <c:when test="${fn:length(BusinessDto.supplierListFirstYear)==0}">
                                            <tr>
                                                <td colspan="6">暂无数据</td>
                                            </tr>
                                        </c:when>
                                        <c:otherwise>
                                            <tr align="right">
                                                <td colspan="6">
                                                    单位：万元
                                                </td>
                                            </tr>
                                            <tr align="center">
                                                <td colspan="6">${BusinessDto.supplierListFirstYear.get(0).year}年度</td>
                                            </tr>
                                            <tr align="center">
                                                <td>
                                                    序号
                                                </td>
                                                <td>
                                                    项目
                                                </td>
                                                <td>
                                                    供应商
                                                </td>
                                                <td>
                                                    主要材料
                                                </td>
                                                <td>
                                                    年采购额
                                                </td>
                                                <td>
                                                    备注
                                                </td>
                                            </tr>
                                            <c:forEach items="${BusinessDto.supplierListFirstYear}" var="bussiness"
                                                       varStatus="s">
                                                <tr align="center">
                                                    <td>
                                                            ${s.count}
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input"
                                                               value="${bussiness.project}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.supplier}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.mainMaterial}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.purchaseAmount}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.note}">
                                                    </td>
                                                </tr>

                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>
                                </table>
                                <table>
                                    <c:choose>
                                        <c:when test="${fn:length(BusinessDto.supplierListSecondYear)==0}">
                                            <tr>
                                                <td colspan="6">暂无数据</td>
                                            </tr>
                                        </c:when>
                                        <c:otherwise>

                                            <tr align="center">
                                                <td colspan="6">${BusinessDto.supplierListSecondYear.get(0).year}年度</td>
                                            </tr>
                                            <tr align="center">
                                                <td>
                                                    序号
                                                </td>
                                                <td>
                                                    项目
                                                </td>
                                                <td>
                                                    供应商
                                                </td>
                                                <td>
                                                    主要材料
                                                </td>
                                                <td>
                                                    年采购额
                                                </td>
                                                <td>
                                                    备注
                                                </td>
                                            </tr>
                                            <c:forEach items="${BusinessDto.supplierListSecondYear}" var="bussiness"
                                                       varStatus="s">
                                                <tr align="center">
                                                    <td>
                                                            ${s.count}
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input"
                                                               value="${bussiness.project}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.supplier}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.mainMaterial}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.purchaseAmount}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.note}">
                                                    </td>
                                                </tr>

                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>
                                </table>
                                <table>
                                    <c:choose>
                                        <c:when test="${fn:length(BusinessDto.supplierListThirdlyYear)==0}">
                                            <tr>
                                                <td colspan="6">暂无数据</td>
                                            </tr>
                                        </c:when>
                                        <c:otherwise>

                                            <tr align="center">
                                                <td colspan="6">${BusinessDto.supplierListThirdlyYear.get(0).year}年度</td>
                                            </tr>
                                            <tr align="center">
                                                <td>
                                                    序号
                                                </td>
                                                <td>
                                                    项目
                                                </td>
                                                <td>
                                                    供应商
                                                </td>
                                                <td>
                                                    主要材料
                                                </td>
                                                <td>
                                                    年采购额
                                                </td>
                                                <td>
                                                    备注
                                                </td>
                                            </tr>
                                            <c:forEach items="${BusinessDto.supplierListThirdlyYear}" var="bussiness"
                                                       varStatus="s">
                                                <tr align="center">
                                                    <td>
                                                            ${s.count}
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input"
                                                               value="${bussiness.project}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.supplier}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.mainMaterial}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.purchaseAmount}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${bussiness.note}">
                                                    </td>
                                                </tr>

                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (三)营销模式
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2">
                                描述公司的营销模式（包括经销、直销等，产品销售中有无返利政策等）或上传相关附件
                            </td>
                            <td colspan="7">
                                 <textarea placeholder="请输入内容" name="desc" class="layui-textarea">
                                     ${BusinessDto.CBusinessmodelWithBLOBs.marketingMemo}
                                 </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn"><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr align="center">
                            <td>
                                近3年主要销售前十名客户
                            </td>
                            <td colspan="7">
                                <table>
                                    <c:choose>
                                    <c:when test="${fn:length(BusinessDto.salescustomerListFirstYear)==0}">
                                        <tr>
                                            <td colspan="6">暂无数据</td>
                                        </tr>
                                    </c:when>
                                    <c:otherwise>
                                                <tr align="right">
                                                    <td colspan="6">
                                                        单位：万元
                                                    </td>
                                                </tr>
                                                <tr align="center">
                                                    <td colspan="6">
                                                        ${BusinessDto.salescustomerListFirstYear.get(0).year}年度
                                                    </td>
                                                </tr>
                                                <tr align="center">
                                                    <td>
                                                        序号
                                                    </td>
                                                    <td>
                                                        客户名称
                                                    </td>
                                                    <td>
                                                        金额
                                                    </td>
                                                    <td>
                                                        占比
                                                    </td>
                                                    <td>
                                                        主要产品
                                                    </td>
                                                    <td>
                                                        备注
                                                    </td>
                                                </tr>
                                                <c:forEach items="${BusinessDto.salescustomerListFirstYear}" var="customer"
                                                          varStatus="s">
                                                <tr align="center">

                                                    <td>
                                                        ${s.count}
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.customerName}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.money}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.proportion}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.mainProducts}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.note}">
                                                    </td>
                                                </tr>

                                                </c:forEach>
                                        </c:otherwise>
                                        </c:choose>

                                </table>
                                <table>
                                    <c:choose>
                                    <c:when test="${fn:length(BusinessDto.salescustomerListSecondYear)==0}">
                                        <tr>
                                            <td colspan="6">暂无数据</td>
                                        </tr>
                                    </c:when>
                                    <c:otherwise>
                                            <tr align="center">
                                                <td colspan="6">
                                                    ${BusinessDto.salescustomerListSecondYear.get(0).year}年度
                                                </td>
                                            </tr>
                                        <c:forEach items="${BusinessDto.salescustomerListSecondYear}" var="customer"
                                                   varStatus="s">
                                            <tr align="center">

                                                <td>
                                                        ${s.count}
                                                </td>
                                                <td>
                                                    <input type="text" name="email" required="" lay-verify="email"
                                                           autocomplete="off" class="layui-input" value="${customer.customerName}">
                                                </td>
                                                <td>
                                                    <input type="text" name="email" required="" lay-verify="email"
                                                           autocomplete="off" class="layui-input" value="${customer.money}">
                                                </td>
                                                <td>
                                                    <input type="text" name="email" required="" lay-verify="email"
                                                           autocomplete="off" class="layui-input" value="${customer.proportion}">
                                                </td>
                                                <td>
                                                    <input type="text" name="email" required="" lay-verify="email"
                                                           autocomplete="off" class="layui-input" value="${customer.mainProducts}">
                                                </td>
                                                <td>
                                                    <input type="text" name="email" required="" lay-verify="email"
                                                           autocomplete="off" class="layui-input" value="${customer.note}">
                                                </td>
                                            </tr>

                                        </c:forEach>
                                    </c:otherwise>
                                    </c:choose>

                                </table>
                                <table>
                                    <c:choose>
                                        <c:when test="${fn:length(BusinessDto.salescustomerListThirdlyYear)==0}">
                                            <tr>
                                                <td colspan="6">暂无数据</td>
                                            </tr>
                                        </c:when>
                                        <c:otherwise>
                                            <tr align="center">
                                                <td colspan="6">
                                                        ${BusinessDto.salescustomerListThirdlyYear.get(0).year}年度
                                                </td>
                                            </tr>
                                            <c:forEach items="${BusinessDto.salescustomerListThirdlyYear}" var="customer"
                                                       varStatus="s">
                                                <tr align="center">

                                                    <td>
                                                            ${s.count}
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.customerName}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.money}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.proportion}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.mainProducts}">
                                                    </td>
                                                    <td>
                                                        <input type="text" name="email" required="" lay-verify="email"
                                                               autocomplete="off" class="layui-input" value="${customer.note}">
                                                    </td>
                                                </tr>

                                            </c:forEach>
                                        </c:otherwise>
                                    </c:choose>

                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (四)研发模式
                            </td>
                        </tr>
                        <tr align="center">
                            <td rowspan="2">
                                描述公司的研发模式或上传相关附件
                            </td>
                            <td colspan="7">
                                 <textarea placeholder="请输入内容" id="desc" name="desc" class="layui-textarea">
                                     ${BusinessDto.CBusinessmodelWithBLOBs.researchMemo}
                                 </textarea>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传相关附件
                                </button>
                            </td>
                        </tr>
                        <tr align="center">
                            <td colspan="8">
                                <button class="layui-btn" lay-filter="add" lay-submit="">保存</button>
                                <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate', 'form', 'upload'], function () {
        var laydate = layui.laydate;
        var form = layui.form;
        var $ = layui.jquery;
        var upload = layui.upload;


        // 监听全选
        form.on('checkbox(checkall)', function (data) {

            if (data.elem.checked) {
                $('tbody input').prop('checked', true);
            } else {
                $('tbody input').prop('checked', false);
            }
            form.render('checkbox');
        });
//指定允许上传的文件类型
        upload.render({
            elem: '#test3'
            , url: 'https://httpbin.org/post' //改成您自己的上传接口
            , accept: 'file' //普通文件
            , done: function (res) {
                layer.msg('上传成功');
                console.log(res);
            }
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });


    });

    /*用户-停用*/
    function member_stop(obj, id) {
        layer.confirm('确认要停用吗？', function (index) {

            if ($(obj).attr('title') == '启用') {

                //发异步把用户状态进行更改
                $(obj).attr('title', '停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!', {icon: 5, time: 1000});

            } else {
                $(obj).attr('title', '启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!', {icon: 5, time: 1000});
            }

        });
    }

    /*用户-删除*/
    function member_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!', {icon: 1, time: 1000});
        });
    }


    function delAll(argument) {
        var ids = [];

        // 获取选中的id
        $('tbody input').each(function (index, el) {
            if ($(this).prop('checked')) {
                ids.push($(this).val())
            }
        });

        layer.confirm('确认要删除吗？' + ids.toString(), function (index) {
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>
</html>